<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- JSTL表达式（判断，循环，输出） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%-- 方法表达式（字符串截取，替换） --%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge，chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta name="renderer" content="webkit">
    <meta name="baidu-site-verification" content="R9XA5lWxu2"/>
    <meta name="author" content="图腾">
    <meta name="keywords" content="图腾">
    <meta name="description" content="图腾">
    <link rel="stylesheet" href="<%=basePath%>plugins/swiper/css/swiper.min.css">
    <link rel="stylesheet" href="<%=basePath%>css/ys.css">
</head>
<body>

<jsp:include page="${basePath}/common.jsp" />

<div class="bg-f3f2f1">
    <div class="detail-wrap container">
        
        <div class="member-wrap">
            <div class="member-box text-center">
                <div class="pic">
                    <img src="${userOperator.headImg}">
                </div>
                <div class="name">
                    <span style="font-size: 18px; font-weight: bold;">${userOperator.operatorName}</span>
                </div>
            </div>

            <div class="member-form">
                <div style="height: 60px;"></div>
                <div class="text-center">奖金：${userOperator.commission} 元</div>
                <div style="height: 20px;"></div>
                <div class="text-center">功德值：${userOperator.meritPoint}</div>
                <%--<div class="title text-center">
                    密码修改
                </div>
                <div class="form-group">
                    <input class="form-input" placeholder="输入旧密码">
                </div>
                <div class="form-group">
                    <input class="form-input" placeholder="输入新密码（6-16位字符）">
                </div>
                <div style="height: 20px"></div>--%>
                <div style="height: 20px"></div>
                <div class="form-group text-center">
                    <button class="btn-group" style="width: 40%; font-weight: bold; background-color: black;" onclick="sign(this)">
                        <c:if test="${nowSign}">
                            签到
                        </c:if>
                        <c:if test="${!nowSign}">
                            已签到
                        </c:if>
                    </button>
                </div>
                <%--<div class="form-group">
                    <button class="btn-group active">返回</button>
                </div>--%>
            </div>
        </div>

    </div>
</div>

<jsp:include page="${basePath}/footer.jsp" />

<script src="<%=basePath%>js/jquery.min.js"></script>
<script src="<%=basePath%>plugins/swiper/js/swiper.min.js"></script>
<script src="<%=basePath%>js/modal_build.js"></script>
<script src="<%=basePath%>js/modal_index.js"></script>
<script>
    document.documentElement.style.fontSize = 200 / 1920 * document.documentElement.clientWidth + 'px';
    window.onresize = function () {
        document.documentElement.style.fontSize = 200 / 1920 * document.documentElement.clientWidth + 'px';
    };

    function sign(btn){
        $(btn).prop("disabled", true);
        $.post("/user/sign", {}, function(res){
            if(res.code == 1){
                alert("签到成功，奖励1点功德值");
                window.location.reload();
            }else{
                alert(res.message);
                $(btn).prop("disabled", false);
            }
        });
    }
</script>
</body>
</html>